import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)


export default new Router({
    routes: [
        {
            path: '/',
            component: () => import('@/views/index'),
        },
        {
            path: '/about',
            // name:'about',
            component: () => import('@/views/about'),
        },
        {
            path: '/hello',
            name:'hello',
            component: () => import('@/views/hello'),
        },
    ]
})

// 防止连续点击多次路由报错
let routerPush = Router.prototype.push;
Router.prototype.push = function push(location) {
    return routerPush.call(this, location).catch(err => err)
}
